
Imports Cdm.DataCore.Entities
Imports Cdm.DataCore.EmployeeSchedule
Imports System.Collections.Generic

Partial Class Case_EmployeeWeeklySchedule
    Inherits System.Web.UI.UserControl


    Public Sub SetDataSource(ByVal itms As List(Of EmployeeScheduleDisplay))
        Me.WeeklyScheduleRepeater.DataSource = itms
        Me.WeeklyScheduleRepeater.DataBind()
    End Sub

    Protected Sub WeeklyScheduleRepeater_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles WeeklyScheduleRepeater.ItemDataBound
        Dim disp As EmployeeScheduleDisplay = e.Item.DataItem
        Dim backgroundColor As String = "Transparent"
        Dim td As HtmlTableCell = e.Item.FindControl("TDschedule")
        If Not disp Is Nothing Then
            If disp.StartDate.Hour >= 12 Then
                backgroundColor = "#E8ECF4"
            End If
            If (disp.ScheduleStatus = 1) Then
                td.Style("background-color") = "#949FB1"
            Else
                td.Style("background-color") = backgroundColor
            End If
        End If
    End Sub
End Class
